﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MudEngine.Parsing.AST
{
    public class BlockStatement : Statement
    {
        public void Add(Statement statement)
        {
            this.Children.Add(statement);
        }

        public override void AcceptVisitor<C>(IAstNodeVisitor<C> visitor, C ctx)
        {
            visitor.VisitBlockStatement(this, ctx);
        }

        public VariableDeclarationStatement FindByName(string name)
        {
            return this.FindFirstByType<VariableDeclarationStatement>(vds => vds.Name.Equals(name), true);
        }
    }
}
